﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace com.kmer.Hook {
	public interface IHook {
		int HookType { get;  }
		/// <summary>
		/// 优先级，值越大越优先
		/// </summary>
		int Priority { get; }
		/// <summary>
		/// 执行Hook
		/// </summary>
		/// <param name="isEnd">是否终止</param>
		/// <param name="pArgs"></param>
		/// <returns>执行成功返回0，其他为错误代码</returns>
		int Execute(out bool isEnd, params object[] pArgs);
	}

	public abstract class BaseHook : IHook {

		public abstract int HookType {
			get;

		}

		public abstract int Priority {
			get;
		}

		public virtual int Execute(out bool isEnd, params object[] pArgs) {
			isEnd = false;
			return 0;
		}
	}
}
